package com.alex.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * 测试自定义的LoadBalaned
 *
 * @author alex.shu
 */
@RestController
public class BalancerController {

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping(value = "/loadBalancer")
    public String testLoadBalancer() {
        String result = restTemplate.getForObject("http://USER-SERVER/user/name", String.class);
        return result;
    }
}
